<?php

namespace common\models\base;

use Yii;

/**
 * This is the model class for table "{{%archive_addon_record}}".
 *
 * @property integer $id
 * @property string $content
 * @property integer $status
 * @property string $ob_object
 * @property string $ob_date
 * @property string $ob_addr
 *
 * @property Archive $id0
 */
class ArchiveAddonRecord extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%archive_addon_record}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id'], 'required'],
            [['id', 'status'], 'integer'],
            [['content'], 'string'],
            [['ob_date'], 'safe'],
            [['ob_object', 'ob_addr'], 'string', 'max' => 255],
            [['id'], 'exist', 'skipOnError' => true, 'targetClass' => Archive::className(), 'targetAttribute' => ['id' => 'id']],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'content' => '内容',
            'status' => '状态',
            'ob_object' => '观察对象',
            'ob_date' => '相关日期',
            'ob_addr' => '观察地点',
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getId0()
    {
        return $this->hasOne(Archive::className(), ['id' => 'id'])->inverseOf('archiveAddonRecord');
    }
}
